#!/usr/bin/env python3

import rospy
from DrEmpower_can.msg import set_mode
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    dr.set_mode(id_num=data.id_num, mode=data.mode)
    rospy.loginfo("set_mode_node")


def listener():
    rospy.init_node("set_mode", anonymous=True)
    rospy.Subscriber("set_mode", set_mode, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

